<%@ page import="org.internna.iwebmvc.security.UserManager" %>
<%@ page import="org.internna.iwebmvc.spring.jee.IWebMvcCombinedFilter" %>
<%@ taglib prefix="iwebmvc" uri="http://tags.iwebmvc.com" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<c-rt:set var="sessionUser" value="<%= UserManager.SESSION_USER %>" />
<c-rt:set var="subsession_id" value="<%= IWebMvcCombinedFilter.SUB_SESSION_COOKIE %>" />
<c-rt:set var="subsession_path" value="<%= IWebMvcCombinedFilter.SUB_SESSION_COOKIE_PATH %>" />
<c-rt:set var="activityClass" value="<%= org.internna.iwebjtracker.model.Activity.class %>" />
<c-rt:set var="projectClass" value="<%= org.internna.iwebjtracker.model.DefaultProject.class %>" />
<c-rt:set var="activityOrder" value='<%= new org.internna.iwebmvc.model.ui.Sort("eventDate", true) %>' />
<iwebmvc:panel title="ui.project.all" width="99%;margin:0">
    <iwebmvc:filteredgrid id="allProjects" entityClass="${projectClass}" currentDepthLevel="0" baseColumnWidth="100" pages="5" rows="7" selectionMode="single" hideFiltersOnLoad="true">
        <div class="overclear" style="vertical-align:top">
            <div class="float_left" style="padding-top:5px;margin-left:15px">
                <iwebmvc:sprite id="allProjectsFilter" text="iwebmvc.ui.crud.filter;${projectClass.name}" sprite="table_${sessionScope[sessionUser].theme}.png" top="-250px" position="after">
                    showprojectActivityFilter("all", true, true);
                </iwebmvc:sprite>
                <iwebmvc:sprite id="allProjectsHide" text="iwebmvc.ui.crud.hide;${projectClass.name}" sprite="table_${sessionScope[sessionUser].theme}.png" top="-300px" style="display:none" position="after">
                    showprojectActivityFilter("all", true, false);
                </iwebmvc:sprite>
            </div>
            <div class="float_right" style="padding-top:6px;padding-right:15px">
                <iwebmvc:sprite id="openProject" text="ui.project.open" sprite="table_${sessionScope[sessionUser].theme}.png" top="-150px" position="before" style="opacity:0.4">
                    var selection = dijit.byId("gridallProjects").selection;
                    if ((selection.selectedIndex >= 0) && (selection.getSelected()[0] != null)) openProjectTab(selection);
                </iwebmvc:sprite>
                <iwebmvc:hide requiredRoles="ROLE_USER">
                    <img id="joinProjectIcon" src="<iwebmvc:url value="/resource.iwebmvc?file=/images/join_${sessionScope[sessionUser].theme}.png&${requestScope[subsession_path]}=${requestScope[subsession_id]}" />" onclick="joinProject()" style="vertical-align:top">
                    <span dojoType="dijit.Tooltip" connectId="joinProjectIcon" position="before">
                        <iwebmvc:message argMessage="ui.project.join" />
                    </span>
                </iwebmvc:hide>
            </div>
        </div>
    </iwebmvc:filteredgrid>
</iwebmvc:panel>
<div class="panelSeparator"></div>
<iwebmvc:panel title="ui.activity.all" width="99%;margin:0">
    <iwebmvc:filteredgrid id="activities" baseColumnWidth="100" currentDepthLevel="0" entityClass="${activityClass}" pages="5" rows="6" maxDepthLevel="2" defaultSort="${activityOrder}" selectionMode="none" hideFiltersOnLoad="true">
        <div class="overclear" style="vertical-align:top">
            <div class="float_left" style="padding-top:5px;margin-left:15px">
                <iwebmvc:sprite id="activitiesFilter" text="iwebmvc.ui.crud.filter;${activityClass.name}" sprite="table_${sessionScope[sessionUser].theme}.png" top="-250px" position="after">
                    showprojectActivityFilter("all", false, true);
                </iwebmvc:sprite>
                <iwebmvc:sprite id="activitiesHide" text="iwebmvc.ui.crud.hide;${activityClass.name}" sprite="table_${sessionScope[sessionUser].theme}.png" top="-300px" style="display:none" position="after">
                    showprojectActivityFilter("all", false, false);
                </iwebmvc:sprite>
            </div>
        </div>
    </iwebmvc:filteredgrid>
</iwebmvc:panel>
<script type="text/javascript">
    dojo.addOnLoad(dashboardOnLoad);
</script>